package com.boyu.common;

import com.boyu.service.ArticleService;
import com.boyu.service.ProductService;
import com.boyu.service.UserService;
import com.jfinal.aop.Duang;
import com.jfinal.core.Controller;

/**
 * BaseController,所有Controller继承此类，类中定义了一些常用的变量，service<br></>
 * service使用与否都可以，小工程，嫌麻烦可以在controller中直接去查数据库
 */
public class BaseController<T> extends Controller {
	protected UserService userService  = Duang.duang(UserService.class);
	protected ProductService productService  = Duang.duang(ProductService.class);
	protected ArticleService articleService  = Duang.duang(ArticleService.class);
	public static final String INDEX_HTML = "index.html";
	public static final String ADD_HTML = "add.html";
	public static final String EDIT_HTML = "edit.html";
	public static final String LIST_HTML = "list.html";
	public static final String DETAIL_HTML = "detail.html";


	public static final String INDEX = "index";
	public static final String COLUMN_ID = "columnId";
	public static final String PARENT_ID = "parentId";
	public static final String COLUMN = "column";
	public static final String MENU = "menu";
	public static final String ID = "id";

	public static final String PAGE_NO = "pageNo";
	public static final int PAGE_SIZE = 20;


	public long getParId() {
		return getParaToLong(ID);
	}
	protected String getModelName() {
		return "";
	}
}





